package exception;
/**
 * 无论try语句中是否出现异常
 * finally都必定执行
 *
 */
public class FinallyDemo {
    public static void main(String[] args) {
        System.out.println("程序开始");

        try {
            String line = null;
            System.out.println(line.length());

        }catch (Exception e){
            System.out.println("出错误了");
            return;
        }finally {
            System.out.println("finally里面的代码执行了");
        }
        System.out.println("程序结束");
        //ctrl+ALt+T 快速生成try catch
    }
}
